package com.tech.zhidengxian.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tech.zhidengxian.model.dataobject.SchoolDO;
import com.tech.zhidengxian.model.dto.SchoolDTO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SchoolMapper extends BaseMapper<SchoolDO> {
    default List<SchoolDO> selectListByName(String keyword){
        LambdaQueryWrapper<SchoolDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(SchoolDO::getName,keyword);
        return selectList(wrapper);
    }
    default List<SchoolDO> selectListByCity(String city){
        LambdaQueryWrapper<SchoolDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(SchoolDO::getCity,city);
        return selectList(wrapper);
    }
}
